package com.doumi.biz.qadev.api.config;

import org.testng.Reporter;

import java.io.InputStream;
import java.util.Properties;

/**
 * Created by WJP on 2019/9/24.
 */
public class PropConfig {
    public static String phone_service_host;
    public static String phone_service_getPhone;
    public static String phone_service_setPhone;
    public static String phone_service_getBindXcode;
    public static String phone_service_setBindXcode;
    public static String phone_service_unBindXcode;
    public static String phone_service_setPlatformLevel;
    public static String phone_service_setPlatformStatus;

    public static String phone_service_count;
    public static String phone_service_realcode;
    public static String phone_service_phoneDetailHeliAxg;
    public static String phone_service_phoneDetailTRAxg;

    public static String driver =null;
    public static String url=null;
    public static String username=null;
    public static String password=null;

    static {
        try {
            Properties prop = new Properties();
            InputStream in = PropConfig.class.getResourceAsStream("/application.properties");
            prop.load(in);
            phone_service_host=prop.getProperty("phone_service.host").trim();
            phone_service_getPhone=prop.getProperty("phone_service.getPhone").trim();
            phone_service_setPhone=prop.getProperty("phone_service.setPhone").trim();
            phone_service_getBindXcode=prop.getProperty("phone_service.getBindXcode").trim();
            phone_service_setBindXcode=prop.getProperty("phone_service.setBindXcode").trim();
            phone_service_unBindXcode=prop.getProperty("phone_service.unBindXcode").trim();
            phone_service_setPlatformLevel=prop.getProperty("phone_service.setPlatformLevel").trim();
            phone_service_setPlatformStatus=prop.getProperty("phone_service.setPlatformStatus").trim();

            phone_service_count=prop.getProperty("phone_service.count").trim();
            phone_service_realcode=prop.getProperty("phone_service.realcode").trim();
            phone_service_phoneDetailHeliAxg=prop.getProperty("phone_service.phoneDetailHeliAxg").trim();
            phone_service_phoneDetailTRAxg=prop.getProperty("phone_service.phoneDetailTRAxg").trim();

            driver=prop.getProperty("driver").trim();
            url=prop.getProperty("url").trim();
            username=prop.getProperty("username").trim();
            password=prop.getProperty("password").trim();

        }catch (Exception e)
        {
            Reporter.log("获取properties文件内容失败，读取文件异常");
        }
    }

    public static void main(String[] args) {
        System.out.println(driver);
    }
}
